﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProjectN.Core
{
    public static class _IdPair_ExtensionMethods
    {
        public static IEnumerable<IdPair<T>> AsIdPair<T>(this IEnumerable<T> enumerable)
        {
            int i = -1;
            foreach (var item in enumerable)
                yield return new(i++, item);
        }
    }
    public record struct IdPair<T>(int Id, T Value)
    {
        public readonly void ReadValues(out int id, out T value)
        {
            id = Id;
            value = Value;
        }
    }
}
